<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>title</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/complaint_details.css"/>
		<style>
			body {
			}
			.m-t {
				margin-top: 13px;
			}
			.color-1 {
				color: #6e6e6e;
			}
			.color-2 {
				color: #b4b4b4;
			}
			.color-3 {
				color: #ff0f2e;
			}
			.color-4 {
				color: #ff8000;
			}
			.color-5 {
				color: #999999;
			}
			/* 接障详情处理结果 */
			.order-result-container {
				margin-top: 20px;
				padding: 15px 15px 30px;
				border-top: #e6e6e6 1px solid;
			}
			/* 可分配的处理人员 */
			.order-result-container .handle-m-container {
				margin-top: 10px;
			}
			.order-result-container .handle-m-container .handle-m {
				padding: 10px 0 0;
				height: 55px;
				text-align: center;
				border: none;
				border-radius: 2.5px;
			}
			.order-result-container .handle-m-container .handle-m.active {
				box-shadow: 0 0 3.5px rgba(118,118,118,71);
			}
			.order-result-container .handle-m-container .handle-m.checked {
				background-color: #5291ff;
				color: #fff;
			}
			.order-result-container .handle-m-container .interval {
				width: 5px;
			}
			.handle-m-container .acms-item-name {
				color: #101010;
				font-size: 14px;
			}
			.handle-m-container .acms-item-phone {
				margin-top: 13px;
				color: #8497ac;
				font-size: 11px;
			}
			/* 按钮 */
			.order-result-container .btn-container {
				margin-top: 28px;
				padding: 0 7.5px;
			}
			.order-result-container .order-result-btn {
				height: 35px;
				line-height: 35px;
				border-radius: 5px;
				text-align: center;
			}
			.order-result-container .interval {
				width: 15px;
			}
			.btn-1 {
				border: #ff9702 2px solid;
				color: #ff9702;
			}
			.btn-2 {
				border: #ff9702 2px solid;
				background-color: #ff9702;
				color: #fff;
			}
			.btn-3 {
				background-color: #f2a23a;
				color: #fff;
			}
			.acms-c1.none, .acms-c2.none, .acms-c3.none, .acms-c4.none, .acms-c5.none, .acms-c6.none {
				display: none;
			}

		</style>
	</head>
	<body>
		<div class="commit-content-container">
			<div class="commit-content-title flex-container flex-between">
				<div id="acms-msg-1">
					--
				</div>
				<div id="acms-msg-2">
					--
				</div>
			</div>
			<div class="commit-content-msg">
				<div>
					<span class="commit-content-msg-title">联系电话：</span><span id="acms-msg-3" class="phone_style">-</span>
				</div>
				<div id="div-acms-msg-16">
					<span class="commit-content-msg-title">校园卡号：</span><span id="acms-msg-16">-</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障地点：</span><span id="acms-msg-4">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">具体地址：</span><span id="acms-msg-5">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">网络类型：</span><span id="acms-msg-6">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">报障时间：</span><span id="acms-msg-7">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障情况：</span><span id="acms-msg-8">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障描述：</span>
					<div id="acms-msg-9">
						--
					</div>
				</div>
			</div>
			<div  id="acms-msg-10-parant" class="camera-container mg-t">
				<img  id="acms-msg-10" class="camera-container-img" src="" />
				<div class="camera-container-delete"></div>
			</div>
		</div>
		<!--待处理:深大--移交電信-->
		<div id="acms-c-1">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-1-msg-1" class="color-4">--</span>
				</div>
				<div >
					<ul id="acms-c-1-msg-2"></ul>
					<div class="btn-container flex-container flex-center-v">
						<div class="order-result-btn flex-item btn-1" id="acms-c-1-msg-3">
							移交
						</div>
						<div class="interval"></div>
						<div class="order-result-btn flex-item btn-2" id="acms-c-1-msg-4">
							确认
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--待处理:深大--移交移动-->
		<div id="acms-c-2">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-2-msg-1" class="color-4">--</span>
				</div>
				<div >
					<ul id="acms-c-2-msg-2"></ul>
					<div class="btn-container flex-container flex-center-v">
						<div class="order-result-btn flex-item btn-1" id="acms-c-2-msg-3">
							移交
						</div>
						<div class="interval"></div>
						<div class="order-result-btn flex-item btn-2" id="acms-c-2-msg-4">
							确认
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 待处理:非深大 -->
		<div id="acms-c-3">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-3-msg-1" class="color-4">--</span>
				</div>
				<div >
					<ul id="acms-c-3-msg-2"></ul>
					<div class="btn-container flex-container flex-center-v">
						<div></div>
						<div></div>
						<div class="order-result-btn flex-item btn-2" id="acms-c-3-msg-3">
							确认
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 结单详情：转为疑难单 -->
		<div id="acms-c-4">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-4-msg-1" class="color-4">--</span>
				</div>
				<div class="m-t color-5">
					<span>接障时间：</span><span id="acms-c-4-msg-2">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理时间：</span><span id="acms-c-4-msg-3">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理状态：</span><span id="acms-c-4-msg-4">--</span>
				</div>
				<div>
					<div class="m-t color-5">
						处理情况：
					</div>
					<div class="m-t" id="acms-c-4-msg-5">
						--
					</div>
				</div>
				<div id="acms-c-4-msg-6-p" class="camera-container mg-t">
					<img class="camera-container-img" src=""  id="acms-c-4-msg-6"/>
					<div class="camera-container-delete"></div>
				</div>
				<div class="acms-c2 m-t btn-container flex-container flex-center-v">
					<div class="flex-item btn-3 order-result-btn" id="acms-c-4-msg-7">
						结束报障
					</div>
					<div class="interval"></div>
					<div class="flex-item btn-3 order-result-btn" id="acms-c-4-msg-8">
						转为疑难单
					</div>
				</div>
			</div>
		</div>
		<!-- 结单详情：转为疑难单 后，已经处理-->
		<div id="acms-c-5">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-5-msg-1" class="color-4">--</span>
				</div>
				<div class="m-t color-5">
					<span>接障时间：</span><span id="acms-c-5-msg-2">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理时间：</span><span id="acms-c-5-msg-3">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理状态：</span><span id="acms-c-5-msg-4">--</span>
				</div>
				<div>
					<div class="m-t color-5">
						处理情况：
					</div>
					<div class="m-t" id="acms-c-5-msg-5">
						--
					</div>
				</div>
				<div id="acms-c-5-msg-6-p" class="camera-container mg-t">
					<img class="camera-container-img" src=""  id="acms-c-5-msg-6"/>
					<div class="camera-container-delete"></div>
				</div>
			</div>
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-5-msg-7" class="color-4">--</span>
				</div>
				<div class="m-t color-5">
					<span>接障时间：</span><span id="acms-c-5-msg-8">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理时间：</span><span id="acms-c-5-msg-9">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理状态：</span><span id="acms-c-5-msg-10">--</span>
				</div>
				<div>
					<div class="m-t color-5">
						处理情况：
					</div>
					<div class="m-t" id="acms-c-5-msg-11">
						--
					</div>
				</div>
				<div id="acms-c-5-msg-12-p" class="camera-container mg-t">
					<img class="camera-container-img" src=""  id="acms-c-5-msg-12"/>
					<div class="camera-container-delete"></div>
				</div>
				<!-- 转疑难单&结束报障 -->
				<div class="acms-c2 m-t btn-container flex-container flex-center-v">
					<div></div>
					<div ></div>
					<div class="btn-3 flex-item order-result-btn" id="acms-c-5-msg-13">
						结束报障
					</div>
				</div>
			</div>
		</div>
		<!-- 疑难单：转派平障人员 -->
		<div id="acms-c-6">
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-6-msg-1" class="color-4">--</span>
				</div>
				<div class="m-t color-5">
					<span>接障时间：</span><span id="acms-c-6-msg-2">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理时间：</span><span id="acms-c-6-msg-3">--</span>
				</div>
				<div class="m-t color-5">
					<span>处理状态：</span><span id="acms-c-6-msg-4">--</span>
				</div>
				<div>
					<div class="m-t color-5">
						处理情况：
					</div>
					<div class="m-t" id="acms-c-6-msg-5">
						--
					</div>
				</div>
				<div id="acms-c-6-msg-6-p" class="camera-container mg-t">
					<img class="camera-container-img" src=""  id="acms-c-6-msg-6"/>
					<div class="camera-container-delete"></div>
				</div>
			</div>
			<div class="order-result-container">
				<div>
					<span>处理员：</span><span id="acms-c-6-msg-7" class="color-4">--</span>
				</div>
				<ul  id="acms-c-6-msg-8"></ul>
				<div class="m-t btn-container flex-container flex-center-v">
					<div class="btn-3 flex-item order-result-btn"id="acms-c-6-msg-9">
						结束报障
					</div>
					<div class="interval"></div>
					<div class="btn-3 flex-item order-result-btn"id="acms-c-6-msg-10">
						提交
					</div>
				</div>
			</div>
		</div>
		<!-- 疑难单：已转派平障人员，还未被处理 -->
		<!-- <div id="acms-c-7">
		<div class="order-result-container">
		<div>
		<span>处理员：</span><span id="acms-c-7-msg-1">--</span>
		</div>
		<div class="m-t">
		<span>接障时间：</span><span id="acms-c-7-msg-2">--</span>
		</div>
		<div class="m-t">
		<span>处理时间：</span><span id="acms-c-7-msg-3">--</span>
		</div>
		<div class="m-t">
		<span>处理状态：</span><span id="acms-c-7-msg-4">--</span>
		</div>
		<div>
		<div class="m-t">
		处理情况：
		</div>
		<div class="m-t" id="acms-c-7-msg-5">
		--
		</div>
		</div>
		<div class="camera-container mg-t">
		<img id="acms-c-7-msg-6-p" class="camera-container-img" src=""  id="acms-c-7-msg-6"/>
		<div class="camera-container-delete"></div>
		</div>
		</div>
		<div class="order-result-container">
		<div>
		<span>处理员：</span><span id="acms-c-7-msg-7">--</span>
		</div>
		<div>
		<span>转派时间：</span><span id="acms-c-7-msg-8">--</span>
		</div>
		</div>
		</div> -->
		<div id="list-member-item-temp">
			<div class="handle-m-container flex-container flex-center-v">
				<div class="handle-m active checked flex-item">
					<div class="acms-item-name"></div>
					<div class="acms-item-phone"></div>
				</div>
				<div class="interval"></div>
				<div class="handle-m flex-item">
					<div class="acms-item-name"></div>
					<div class="acms-item-phone"></div>
				</div>
				<div class="interval"></div>
				<div class="handle-m flex-item">
					<div class="acms-item-name"></div>
					<div class="acms-item-phone"></div>
				</div>
				<div class="interval"></div>
				<div class="handle-m flex-item">
					<div class="acms-item-name"></div>
					<div class="acms-item-phone"></div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/request.js"></script>
	<script type="text/javascript" src="../../script/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
		//标记：用以标记是从哪个页面进来的。1==接障。2==结单。3==疑难单。4==接障搜索结果
		var mTag;
		//故障id
		var mCpId;
		//此故障的区域的id
		var mCpAreaId;
		//不同模块显示不同的view
		var mCs = [];
		//故障处理人员列表
		var mMemberLv;
		//故障处理人员列表数据
		var mMemberLvDatas;
		//选中的分派人员的index
		var mMemberIndex;
		var time = 0;
		apiready = function() {
			initData();
			requestCpDetails(mCpId);
		};
		function initData() {
			mCpId = api.pageParam.id;
			mTag = api.pageParam.tag;
	 }

		function initView(data) {
			//状态： 1 待处理 2.已受理 3 .处理中  4.已处理 5.疑难单 6.报障关闭 7.已完成
			var status = data.status;
			//是否二次受理过
			var isTwo = data.two == 0 ? false : true;
			var doc = document;
			refleshView(doc);
			showView(doc, data);
			//处理状态
			var msg_2 = doc.getElementById('acms-msg-2');
			console.log('s=' + status);
			switch(parseInt(status)) {
				case 1:
					if (data.protect_id == 11) {
						showView1(doc, data);
					} else if (data.protect_id == 12) {
						showView2(doc, data);
					} else {
						showView3(doc, data)
					}
					msg_2.innerText = '待处理';
					break;
				case 4:
					if (isTwo) {
						showView5(doc, data);
						msg_2.innerText = '已二次处理';
					} else {
						showView4(doc, data);
						msg_2.innerText = '已处理';
					}
					break;
				case 5:
					showView6(doc, data)
					msg_2.innerText = '疑难单';
					break;
				default:
					MyCom.errorTip(2);
			}
		}

		/**
		 * 让view重新回归初始样式
		 */
		function refleshView(doc) {
			console.log('refleshView');
			var c;
			for (var i = 1; i < 7; i++) {
				c = doc.getElementById('acms-c-' + i);
				c.style.display = 'none';
				mCs.push(c);
			}
		}

		/**
		 * 展示一般view
		 */
		function showView(doc, data) {
			console.log('showView');
			//姓名
			var msg_1 = doc.getElementById('acms-msg-1');
			//电话
			var msg_3 = doc.getElementById('acms-msg-3');
			//地点
			var msg_4 = doc.getElementById('acms-msg-4');
			//具体地址
			var msg_5 = doc.getElementById('acms-msg-5');
			//网络类型
			var msg_6 = doc.getElementById('acms-msg-6');
			//报障时间
			var msg_7 = doc.getElementById('acms-msg-7');
			//故障情况
			var msg_8 = doc.getElementById('acms-msg-8');
			//故障描述
			var msg_9 = doc.getElementById('acms-msg-9');
			//报障图片
			var msg_10 = doc.getElementById('acms-msg-10');
			var msg_10_p = doc.getElementById('acms-msg-10-parant');
			msg_1.innerText = MyCom.dataFaultTolerant(data.nick_name);
			msg_3.innerText = MyCom.dataFaultTolerant(data.user_phone);
			msg_4.innerText = MyCom.dataFaultTolerant(data.warn_location);
			msg_5.innerText = MyCom.dataFaultTolerant(data.address);
			if (data.internet_type == 1) {
				msg_6.innerText = '宽带网络';
			} else if (data.internet_type == 2) {
				msg_6.innerText = 'WiFi';
			} else {
				msg_6.innerText = '--';
			}
			msg_7.innerText = MyCom.dataFaultTolerant(data.create_time);
			msg_8.innerText = MyCom.dataFaultTolerant(data.title);
			msg_9.innerText = MyCom.dataFaultTolerant(data.content);

			//校园卡号
			var msg16 = doc.getElementById('acms-msg-16');
				console.log(".......msg16............"+data.school_number);
				if(typeof(data.school_number) == 'undefined' || typeof(data.school_number) === ''){
					var divMsg16 = doc.getElementById('div-acms-msg-16');
					divMsg16.style.display = 'none';
				}else {
						msg16.innerText = MyCom.dataFaultTolerant(data.school_number);
				}

			if (data.images == null) {
				msg_10_p.style.display = 'none';
			} else {
				msg_10_p.style.display = 'block';
				msg_10.src = data.images;
				msg_10.onclick = function() {
					openLargePicPg(data.images);
				}
			}
			msg_3.onclick = function() {
				MyCom.callPhone(data.user_phone);
			}

		}

		/**
		 * 展示待处理，移交电信
		 */
		function showView1(doc, data) {
			console.log('showView1');
			mCs[0].style.display = 'block';
			//分配的处理员
			var msg_1 = doc.getElementById('acms-c-1-msg-1');
			//处理员人员列表
			var msg_2 = doc.getElementById('acms-c-1-msg-2');
			//移交电信按钮
			var msg_3 = doc.getElementById('acms-c-1-msg-3');
			//确认按钮
			var msg_4 = doc.getElementById('acms-c-1-msg-4');
			msg_1.innerText = '未分配';
			msg_3.onclick = function() {
				//移交给电信
				requestTurnOver();
			}
			msg_4.onclick = function() {
				//确认(分配人员)
				requestAllotMember();
			}
			requestHandleMember(msg_2, mCpAreaId);
		}

		/**
		 * 展示待处理，移交移动
		 */
		function showView2(doc, data) {
			console.log('showView2');
			mCs[1].style.display = 'block';
			//分配的处理员
			var msg_1 = doc.getElementById('acms-c-2-msg-1');
			//处理员人员列表
			var msg_2 = doc.getElementById('acms-c-2-msg-2');
			//移交移动按钮
			var msg_3 = doc.getElementById('acms-c-2-msg-3');
			//确认按钮
			var msg_4 = doc.getElementById('acms-c-2-msg-4');
			msg_1.innerText = '未分配';
			msg_3.onclick = function() {
				//移交给移动
				requestTurnOver();
			}
			msg_4.onclick = function() {
				//确认(分配人员)
				requestAllotMember();
			}
			requestHandleMember(msg_2, mCpAreaId);
		}

		/**
		 * 展示待处理，非深大
		 */
		function showView3(doc, data) {
			console.log('showView3');
			mCs[2].style.display = 'block';
			//分配的处理员
			var msg_1 = doc.getElementById('acms-c-3-msg-1');
			//处理员人员列表
			var msg_2 = doc.getElementById('acms-c-3-msg-2');
			//确认按钮
			var msg_3 = doc.getElementById('acms-c-3-msg-3');
			msg_1.innerText = '未分配';
			msg_3.onclick = function() {
				//确认(分配人员)
				requestAllotMember();
			}
			requestHandleMember(msg_2, mCpAreaId);
		}

		/**
		 * 展示转为疑难单&&结束报障
		 */
		function showView4(doc, data) {
			console.log('showView4');
			//故障处理完时上传的图片的url
			var imgSrc = data.action_imges;
			//是否已经解决
			var isHandled = data.action_status == 1 ? true : false;
			mCs[3].style.display = 'block';
			//处理员
			var msg_1 = doc.getElementById('acms-c-4-msg-1');
			//接障时间
			var msg_2 = doc.getElementById('acms-c-4-msg-2');
			//处理时间
			var msg_3 = doc.getElementById('acms-c-4-msg-3');
			//处理状态
			var msg_4 = doc.getElementById('acms-c-4-msg-4');
			//处理情况
			var msg_5 = doc.getElementById('acms-c-4-msg-5');
			//故障处理上传的图片
			var msg_6 = doc.getElementById('acms-c-4-msg-6');
			var msg_6_p = doc.getElementById('acms-c-4-msg-6-p');
			//结束报障的按钮
			var msg_7 = doc.getElementById('acms-c-4-msg-7');
			//转为疑难单按钮
			var msg_8 = doc.getElementById('acms-c-4-msg-8');
			msg_1.innerText = MyCom.dataFaultTolerant(data.action_person) + MyCom.dataFaultTolerant(data.action_phone);
			msg_2.innerText = MyCom.dataFaultTolerant(data.dispatch_time);
			msg_3.innerText = MyCom.dataFaultTolerant(data.action_time);
			if (isHandled) {
				msg_4.innerText = '已解决';
			} else {
				msg_4.innerText = '未解决';
			}
			msg_5.innerText = MyCom.dataFaultTolerant(data.action_result);
			if (imgSrc == null) {
				msg_6_p.style.display = 'none';
			} else {
				msg_6_p.style.display = 'block';
				msg_6.src = MyCom.dataFaultTolerant(imgSrc);
				msg_6.onclick = function() {
					openLargePicPg(imgSrc);
				}
			}
			msg_7.onclick = function() {
				reuqestEndCp(mCpId, 7);
			}
			msg_8.onclick = function() {
				//转为疑难单
				reuqestEndCp(mCpId, 5);
			}
			msg_1.onclick = function() {
				//打电话
				MyCom.callPhone(data.action_phone);
			}
		}

		/**
		 * 展示转为疑难单后，已处理
		 */
		function showView5(doc, data) {
			console.log('showView5');
			//故障处理完时上传的图片的url
			var imgSrc = data.action_imges;
			//是否已经解决
			var isHandled = data.action_status == 1 ? true : false;
			//二次处理---故障处理完时上传的图片的url
			var imgSrc2 = data.two_action_imges;
			//二次处理---是否已经解决
			var isHandled2 = data.two_action_status == 1 ? true : false;
			mCs[4].style.display = 'block';
			//处理员
			var msg_1 = doc.getElementById('acms-c-5-msg-1');
			//接障时间
			var msg_2 = doc.getElementById('acms-c-5-msg-2');
			//处理时间
			var msg_3 = doc.getElementById('acms-c-5-msg-3');
			//处理状态
			var msg_4 = doc.getElementById('acms-c-5-msg-4');
			//处理情况
			var msg_5 = doc.getElementById('acms-c-5-msg-5');
			//故障处理上传的图片
			var msg_6 = doc.getElementById('acms-c-5-msg-6');
			var msg_6_p = doc.getElementById('acms-c-5-msg-6-p');
			//二次处理--处理员
			var msg_7 = doc.getElementById('acms-c-5-msg-7');
			//二次处理--接障时间
			var msg_8 = doc.getElementById('acms-c-5-msg-8');
			//二次处理--处理时间
			var msg_9 = doc.getElementById('acms-c-5-msg-9');
			//二次处理--处理状态
			var msg_10 = doc.getElementById('acms-c-5-msg-10');
			//二次处理--处理情况
			var msg_11 = doc.getElementById('acms-c-5-msg-11');
			//二次处理--故障处理上传的图片
			var msg_12 = doc.getElementById('acms-c-5-msg-12');
			var msg_12_p = doc.getElementById('acms-c-5-msg-12-p');
			//结束报障按钮
			var msg_13 = doc.getElementById('acms-c-5-msg-13');
			msg_1.innerText = MyCom.dataFaultTolerant(data.action_person) + MyCom.dataFaultTolerant(data.action_phone);
			msg_2.innerText = MyCom.dataFaultTolerant(data.dispatch_time);
			msg_3.innerText = MyCom.dataFaultTolerant(data.action_time);
			if (isHandled) {
				msg_4.innerText = '已解决';
			} else {
				msg_4.innerText = '未解决';
			}
			msg_5.innerText = MyCom.dataFaultTolerant(data.action_result);
			if (imgSrc == null) {
				msg_6_p.style.display = 'none';
			} else {
				msg_6_p.style.display = 'block';
				msg_6.src = MyCom.dataFaultTolerant(imgSrc);
				msg_6.onclick = function() {
					openLargePicPg(imgSrc);
				}
			}
			//二次处理
			msg_7.innerText = MyCom.dataFaultTolerant(data.two_action_person) + MyCom.dataFaultTolerant(data.two_action_phone);
			msg_8.innerText = MyCom.dataFaultTolerant(data.two_dispatch_time);
			msg_9.innerText = MyCom.dataFaultTolerant(data.two_action_time);
			if (isHandled2) {
				msg_10.innerText = '已解决';
			} else {
				msg_10.innerText = '未解决';
			}
			msg_11.innerText = MyCom.dataFaultTolerant(data.two_action_result);
			if (imgSrc2 == null) {
				msg_12_p.style.display = 'none';
			} else {
				msg_12_p.style.display = 'block';
				msg_12.src = MyCom.dataFaultTolerant(imgSrc2);
				msg_12.onclick = function() {
					openLargePicPg(imgSrc2);
				}
			}
			msg_13.onclick = function() {
				//结束报障
				reuqestEndCp(mCpId, 7);
			}
			msg_1.onclick = function() {
				//打电话
				MyCom.callPhone(data.action_phone);
			}
			msg_7.onclick = function() {
				//打电话
				MyCom.callPhone(data.two_action_phone);
			}
		}

		/**
		 * 展示疑难单---->转派平障人员
		 */
		function showView6(doc, data) {
			console.log('showView6');
			//故障处理完时上传的图片的url
			var imgSrc = data.action_imges;
			//是否已经解决
			var isHandled = data.action_status == 1 ? true : false;
			mCs[5].style.display = 'block';
			//处理员
			var msg_1 = doc.getElementById('acms-c-6-msg-1');
			//接障时间
			var msg_2 = doc.getElementById('acms-c-6-msg-2');
			//处理时间
			var msg_3 = doc.getElementById('acms-c-6-msg-3');
			//处理状态
			var msg_4 = doc.getElementById('acms-c-6-msg-4');
			//处理情况
			var msg_5 = doc.getElementById('acms-c-6-msg-5');
			//故障处理上传的图片
			var msg_6 = doc.getElementById('acms-c-6-msg-6');
			var msg_6_p = doc.getElementById('acms-c-6-msg-6-p');
			//二次处理--处理员
			var msg_7 = doc.getElementById('acms-c-6-msg-7');
			//二次处理--人员列表
			var msg_8 = doc.getElementById('acms-c-6-msg-8');
			//二次处理--结束报障按钮
			var msg_9 = doc.getElementById('acms-c-6-msg-9');
			//二次处理--提交按钮
			var msg_10 = doc.getElementById('acms-c-6-msg-10');
			msg_1.innerText = MyCom.dataFaultTolerant(data.action_person) + MyCom.dataFaultTolerant(data.action_phone);
			msg_2.innerText = MyCom.dataFaultTolerant(data.dispatch_time);
			msg_3.innerText = MyCom.dataFaultTolerant(data.action_time);
			if (isHandled) {
				msg_4.innerText = '已解决';
			} else {
				msg_4.innerText = '未解决';
			}
			msg_5.innerText = MyCom.dataFaultTolerant(data.action_result);
			if (imgSrc == null) {
				msg_6_p.style.display = 'none';
			} else {
				msg_6_p.style.display = 'block';
				msg_6.src = MyCom.dataFaultTolerant(imgSrc);
				msg_6.onclick = function() {
					openLargePicPg(imgSrc);
				}
			}
			msg_7.innerText = '未分配';
			msg_9.onclick = function() {
				reuqestEndCp(mCpId, 7);
			}
			msg_10.onclick = function() {
				requestAllotMember();
			}
			msg_1.onclick = function() {
				//打电话
				MyCom.callPhone(data.action_phone);
			}
			requestHandleMember(msg_8, mCpAreaId);
		}

		//		/**
		//		 * 疑难单：已转派平障人员，还未被处理
		//		 */
		//		function showView7(doc, data) {
		//			console.log('showView7');
		//			//故障处理完时上传的图片的url
		//			var imgSrc = data.action_imges;
		//			//是否已经解决
		//			var isHandled = data.action_status == 1 ? true : false;
		//			mCs[6].style.display = 'block';
		//			//处理员
		//			var msg_1 = doc.getElementById('acms-c-7-msg-1');
		//			//接障时间
		//			var msg_2 = doc.getElementById('acms-c-7-msg-2');
		//			//处理时间
		//			var msg_3 = doc.getElementById('acms-c-7-msg-3');
		//			//处理状态
		//			var msg_4 = doc.getElementById('acms-c-7-msg-4');
		//			//处理情况
		//			var msg_5 = doc.getElementById('acms-c-7-msg-5');
		//			//故障处理上传的图片
		//			var msg_6 = doc.getElementById('acms-c-7-msg-6');
		//			var msg_6_p = doc.getElementById('acms-c-7-msg-6-p');
		//			//二次处理--处理员
		//			var msg_7 = doc.getElementById('acms-c-7-msg-7');
		//			//二次处理--分配人员时间
		//			var msg_8 = doc.getElementById('acms-c-7-msg-8');
		//			msg_1.innerText = MyCom.dataFaultTolerant(data.action_person);
		//			msg_2.innerText = MyCom.dataFaultTolerant(data.dispatch_time);
		//			msg_3.innerText = MyCom.dataFaultTolerant(data.action_time);
		//			if (isHandled) {
		//				msg_4.innerText = '已解决';
		//			} else {
		//				msg_4.innerText = '未解决';
		//			}
		//			msg_5.innerText = MyCom.dataFaultTolerant(data.action_result);
		//			if (imgSrc == null) {
		//				msg_6_p.style.display = 'none';
		//			} else {
		//				msg_6_p.style.display = 'block';
		//				msg_6.src = MyCom.dataFaultTolerant(imgSrc);
		//			}
		//			msg_7.innerText = MyCom.dataFaultTolerant(data.sr);
		//			msg_8.innerText = MyCom.dataFaultTolerant(data.st);
		//		}
		/**
		 * 展示人员列表
		 */
		function showMemberList(ulView, datas) {
			mMemberLv = ulView;
			mMemberLvDatas = datas;
			var dl = datas.length;
			//4个数据为1行
			var l1 = dl % 4;
			var l2 = parseInt(dl / 4);
			var len;
			if (l1 == 0) {
				len = l2;
			} else {
				len = l2 + 1;
			}
			var i = 0;
			var item;
			var index = 0;
			var endIndex = 4;
			for (; i < len; i++) {
				index = 4 * i;
				//如果i<最大行，行的item就有4个，反之,行的item=总item-最大行之前的item
				if (i < len - 1) {
					endIndex = (i + 1) * 4;
				} else {
					endIndex = dl;
				}
				item = createMemberListItem(datas.slice(index, endIndex));
				mMemberLv.appendChild(item);
			}
		}

		/**
		 * 创建 人员列表item
		 * @param{Array} datas - 每行的数据
		 */
		function createMemberListItem(datas) {
			var isClick1 = false;
			var click1Index = 0;
			var datasLen = datas.length;
			var i = 0;
			var li = document.createElement('li');
			li.innerHTML = document.getElementById('list-member-item-temp').innerHTML;
			var item_subs = li.getElementsByClassName('handle-m');
			var name;
			var phone;
			for (; i < datasLen; i++) {
				item_subs[i].className = 'handle-m active flex-item';
				name = item_subs[i].getElementsByClassName('acms-item-name')[0];
				phone = item_subs[i].getElementsByClassName('acms-item-phone')[0];
				name.innerText = MyCom.dataFaultTolerant(datas[i].user_name);
				phone.innerText = MyCom.dataFaultTolerant(datas[i].user_phone);
				item_subs[i].onclick = function() {
					var ms = mMemberLv.getElementsByClassName('handle-m');
					var len = ms.length;
					var i = 0;
					for (; i < len; i++) {
						if (this == ms[i]) {
							//如果点击的是展示出来的view，那么就设置checked，反之，不做改变
							if (ms[i].className.indexOf('active') == -1) {
							} else {
								this.className = 'handle-m active checked flex-item';
								click1Index = i;
								isClick1 = true;
							}
						} else {
							if (ms[i].className.indexOf('active') == -1) {
								ms[i].className = 'handle-m  flex-item';
							} else {
								ms[i].className = 'handle-m active flex-item';
							}
						}
					}
				}
			}
			li.onclick = function() {
				var clickIndex = 0;
				var lis = mMemberLv.getElementsByTagName('li');
				var i = 0;
				for (; i < lis.length; i++) {
					if (this == lis[i]) {
						clickIndex = i;
						break;
					}
				}
				if (isClick1) {
					isClick1 = false;
					mMemberIndex = click1Index;
				} else {
				}
			}
			return li;
		}

		/**
		 * 打开大图页
		 * @param{String} url - 图片url
		 */
		function openLargePicPg(url) {
			console.log('------------1');
			api.openWin({
				name : 'ImageShow',
				url : '../ImageShow.html',
				pageParam : {
					'url' : url
				}
			});
		}

		/**
		 * 服务器请求：获取报障详情
		 * @param{Number} cpid - 故障id
		 */
		function requestCpDetails(cpid) {
			api.showProgress({
			});
			var data = {
				values : {
					'id' : cpid
				}
			};
			var url = $api.getStorage(MyCom.key_server) + MyRequest.URL_CP_DETAILS;
			MyRequest.requestMethod(url, data, function(re) {
				if (re) {
					console.log('获取故障详情--re=' + JSON.stringify(re));
					var code = re.code;
					var list = re.list[0];
					if (code == 1) {
						mCpAreaId = list.protect_id;
						initView(list);
						api.hideProgress();
					} else {
						api.hideProgress();
						api.toast({
							msg : re.msg
						});
					}
				} else {
					api.hideProgress();
					MyCom.errorTip(2);
				}
			});
		}

		/**
		 * 服务器请求：获取故障处理人员接口 URL_HANDLE_MEMBER
		 * @param{HtmlDom} ulView - 人员列表dom对象
		 * @param{Number} areaid - 区域id
		 */
		function requestHandleMember(ulView, areaid) {
			api.showProgress({
			});
			var data = {
				values : {
					'protect_id' : areaid
				}
			};
			var url = $api.getStorage(MyCom.key_server) + MyRequest.URL_HANDLE_MEMBER;
			MyRequest.requestMethod(url, data, function(re) {
				if (re) {
					console.log('获取故障处理人员--re=' + JSON.stringify(re));
					var code = re.code;
					if (code == 1) {
						showMemberList(ulView, re.list);
						api.hideProgress();
					} else {
						api.hideProgress();
						api.toast({
							msg : re.msg
						});
					}
				} else {
					api.hideProgress();
					MyCom.errorTip(2);
				}
			});
		}

		/**
		 *服务器请求：结束报障或转疑难单
		 * @param{Number} cpid - 故障id
		 * @param{Number} type - 7==已完成,5==转疑难单
		 */
		function reuqestEndCp(cpid, type) {
			api.showProgress({
			});
			var data = {
				values : {
					'id' : cpid,
					'status' : type
				}
			};
			var url = $api.getStorage(MyCom.key_server) + MyRequest.URL_END_CP;
			MyRequest.requestMethod(url, data, function(re) {
				console.log('结束报障或转疑难单--ret=' + JSON.stringify(re));
				if (re) {
					var code = re.code;
					api.hideProgress();
					if (code == 1) {
						if (type == 5) {
							api.toast({
								msg : '转疑难单成功！'
							});
						} else {
							api.toast({
								msg : '结合报障成功！'
							});
						}
						triggerRemoveItemListener();
						api.closeWin({
						});
					} else {
						api.toast({
							msg : re.msg
						});
					}
				} else {
					api.toast({
						msg : '连接服务器失败'
					});
				}
			});
		}

		/**
		 * 服务器请求：分配人员处理故障
		 * @param{Object} data - 人员信息对象
		 */
		function requestAllotMember() {
			if (mMemberIndex == null) {
				api.toast({
					msg : '请选择故障处理人员！'
				});
				return;
			}
			var data = mMemberLvDatas[mMemberIndex];
			api.showProgress({
			});
			var data = {
				values : {
					'id' : mCpId,
					'action_userid' : data.user_id,
					'action_person' : data.user_name,
					'action_phone' : data.user_phone
				}
			};
			var url = $api.getStorage(MyCom.key_server) + MyRequest.URL_ALLOT_MEMBER;
			MyRequest.requestMethod(url, data, function(re) {
				console.log('分配人员处理故障接口---re=' + JSON.stringify(re));
				api.hideProgress();
				if (re) {
					var code = re.code;
					if (code == 1) {
						api.toast({
							msg : '分配成功'
						});
						triggerRemoveItemListener();
						api.closeWin({
						});
					} else {
						api.toast({
							msg : re.msg
						});
					}
				} else {
					api.toast({
						msg : '连接服务器失败'
					});
				}
			});
		}

		/**
		 * 服务器请求：移交故障给电信或移动
		 * @param{Object} type - 1==移交个电信，2==移交给移动
		 */
		function requestTurnOver() {
			var id = mCpAreaId == 11 ? 12 : 11;
			api.showProgress({
			});
			var data = {
				values : {
					'id' : mCpId,
					'protect_id' : id
				}
			};
			var url = $api.getStorage(MyCom.key_server) + MyRequest.URL_TURN_OVER;
			MyRequest.requestMethod(url, data, function(re) {
				console.log('移交故障给电信或移动--接障--ret=' + JSON.stringify(re));
				if (re) {
					var code = re.code;
					api.hideProgress();
					if (code == 1) {
						api.toast({
							msg : '移交成功'
						});
						triggerRemoveItemListener();
						api.closeWin({
						});
					} else {
						api.toast({
							msg : re.msg
						});
					}
				} else {
					api.toast({
						msg : '连接服务器失败'
					});
				}
			});
		}

		/**
		 * 触发“移除item”的监听--接障，结单，疑难单
		 */
		function triggerRemoveItemListener() {
			var name;
			switch(mTag) {
				case 1:
					name = 'RemoveJZListener';
					break;
				case 2:
					name = 'RemoveJDListener';
					break;
				case 3:
					name = 'RemoveYNDListener';
					break;
				case 4:
					name = 'RemoveSearchResultListener';
					break;
				default:
					MyCom.errorTip(1);
					return;
			}
			api.sendEvent({
				name : name
			});
		}
	</script>
</html>
